# encoding: utf-8
# id                       | integer                     | not null default nextval('transacoes_id_seq'::regclass)
# data                     | date                        | 
# valor                    | numeric(10,2)               | 
# observacao               | character varying(255)      | 
# conta_id                 | integer                     | 
# tipo                     | integer                     | 
# created_at               | timestamp without time zone | not null
# updated_at               | timestamp without time zone | not null
# type                     | character varying(255)      | 
# quitada                  | boolean                     | default false
# usuario_id               | integer                     | 
# transacao_relacionada_id | integer                     | 
class Credito < Transacao
  attr_protected
  
  after_initialize do |credito|
  	credito.tipo = CREDITO.id
  	credito.data = Date.today unless credito.data
  end
  
  validates :valor, :conta_id,
  	:presence => true

end
